var express = require('express');
var router = express.Router();
var wechat = require('wechat');
var config = require('../config/config');
var config = {
  token : config.wechat.token,
  appid : config.wechat.appID,
  appsecret :config.wechat.appSecret,
  encodingAESKey : ''
};
router.use(express.query());
 
router.use('/', wechat(config, function(req, res, next) {
	console.log(req.weixin);
	var message = req.weixin;
	console.log(message.Content)
	//文本
	if (message.Content === '1') {  
 
		res.reply('hehe');
	}
 
}));
 
module.exports = router;